package com.yuan.model_convenient.repository;

import com.yuan.model_convenient.domain.ConvenientActivity;
import com.yuan.model_convenient.domain.ConvenientActivityEnroll;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface ConvenientActivityEnrollDao extends JpaRepository<ConvenientActivityEnroll, Integer>, JpaSpecificationExecutor<ConvenientActivityEnroll> {

    @Query(value = "select cae from ConvenientActivityEnroll cae where cae.activityId = :activityId AND cae.userId = :userId")
    ConvenientActivityEnroll findConvenientActivityEnrollByTwoId(Integer activityId, Long userId);
}
